package com.umeox.watch.moto.dataservice.db.model;


import androidx.annotation.NonNull;
import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.Ignore;
import androidx.room.PrimaryKey;

@Entity(tableName = BuddyInfo.TABLE_NAME)
public class BuddyInfo {
    @Ignore
    public static final String TABLE_NAME = "buddy_info";

    @NonNull
    @PrimaryKey
    private String friendId;
    /**
     * 好友类型 0：管理员，1：关注者，2：设备好友，9：群组
     */
    private int type;

    private String name;

    @ColumnInfo(defaultValue = "")
    private String avatar;

    private long createTime;

    private String hiddenFeatures;

    @Ignore
    public boolean isAdmin = false;

    public String getFriendId() {
        return friendId;
    }

    public void setFriendId(String friendId) {
        this.friendId = friendId;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(long createTime) {
        this.createTime = createTime;
    }

    public String getHiddenFeatures() {
        return hiddenFeatures;
    }

    public void setHiddenFeatures(String hiddenFeatures) {
        this.hiddenFeatures = hiddenFeatures;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof BuddyInfo)) return false;

        BuddyInfo buddyInfo = (BuddyInfo) o;

        return friendId.equals(buddyInfo.friendId);
    }

    @Override
    public int hashCode() {
        return friendId.hashCode();
    }

    @Override
    public String toString() {
        return "BuddyInfo{" +
                "friendId='" + friendId + '\'' +
                ", type=" + type +
                ", name='" + name + '\'' +
                ", avatar='" + avatar + '\'' +
                ", createTime=" + createTime +
                ", hiddenFeatures='" + hiddenFeatures + '\'' +
                ", isAdmin=" + isAdmin +
                '}';
    }
}
